package edu.isistan.metamodel;

public class Array extends Collection {
	
	public Array() {
	}
	
	public Array(Array array){
		super(array);
	}
	public Array(String name, DataType dataType, String doc) {
		super(name, dataType, doc);
	}

	@Override
	public boolean isArray() {
		return true;
	}
	
	@Override
	public String toString() {
		StringBuffer sb = new StringBuffer();
		sb.append(" Array ");
		sb.append(getDataType().getType());
		sb.append("[");
		sb.append(" DataType " + this.getDataType().toString());
		sb.append("]");
		return sb.toString();
	}

	@Override
	public String getPrettyPrintType() {
		return getDataType().getPrettyPrintType() + "[]";
	}
	
	@Override
	public DataType copy() {
		Array array= new Array(this.name, this.dataType.copy(), this.doc);
		array.setCardinality(dataType.getCardinality());
		return array;
	}
}
